const Path = require("path")

const baseConfig = {
    entry: "./src/Exports.ts",
    mode: "production",
    output: {
        filename: "message_bus.browser.bundle.production.js",
        path: Path.resolve(__dirname, "bin"),
        library: "dream_rpc_message_bus",
        libraryTarget: "window"
    },
    externals: [
        "dream_rpc"
    ],
    resolve: {
        extensions: [".ts", ".js"]
    },
    module: {
        rules: [
            {
                test: /.+.tsx?$/,
                loader: "babel-loader"
            }
        ]
    }
}

module.exports = [
    {
        ...baseConfig,
        output: {
            ...baseConfig.output,
            filename: "message_bus.browser.bundle.development.js"
        },
        mode: "development"
    },
    baseConfig
]